/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
* File Name          : platform_config.h
* Author             : MCD Application Team
* Version            : V2.0.3
* Date               : 09/22/2008
* Description        : Evaluation board specific configuration file.
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __PLATFORM_CONFIG_H
#define __PLATFORM_CONFIG_H

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_it.h"
#include "fsmc_nor.h"
#include "stdio.h"



/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* global variable ------------------------------------------------------------*/
extern   u16 FSMC_DATA;
extern   u32 FSMC_ADDR;
extern   u16 keyboard_sign;
extern   u16 keyboard_coordinate;
//extern   u16 buffer;

/* global  define ------------------------------------------------------------*/
#define  open         0x01   
#define  close        0x00  

/* Control line address */
#define  row          0x1000000
#define  line         0x1800000

/* KeyBoard */
#define  up_none      0x0f
#define  left_line4   0x17
#define  right_line3  0x1b
#define  down_line2   0x001d
#define  sel_line1    0x001e
#define  row_all      0x0000
#define  joystick     0x0007
#define  row_1        0x000b
#define  row_2        0x000d
#define  row_3        0x000e
#define  keypad_1     0x01 
#define  keypad_2     0x02  
#define  keypad_3     0x03   
#define  keypad_4     0x04   
#define  keypad_5     0x05  
#define  keypad_6     0x06   
#define  keypad_7     0x07   
#define  keypad_8     0x08
#define  keypad_9     0x09 
#define  keypad_0     0x10 
#define  keypad_star    0x11
#define  keypad_well    0x12   
#define  keypad_up    0x13   
#define  keypad_down  0x14
#define  keypad_left  0x15  
#define  keypad_right 0x16  
#define  keypad_sel   0x17   
#define  dot_up       0*8  
#define  dot_down     1*8  
#define  dot_left     2*8
#define  dot_right    3*8
#define  dot_sel      4*8 

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

void RCC_Configuration(void);
void NVIC_Configuration(void);
void GPIO_Configuration(void);
void EXTI_Configuration(void);
void USART_Configuration(void);
void KeyBoard_init(void);
void Delaytime(u32 nCount);

#endif /* __PLATFORM_CONFIG_H */

/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
